#ifndef DIAMOND_INHERITANCE_H_
#define DIAMOND_INHERITANCE_H_
#include<iostream>
using namespace std;
class Base1
{

public:
    int age;
    Base1(int age)
    {
        this->age = age;
    }
    virtual void printAge() {
        cout<< "Base1" << age << endl;
    }
};

class B : public virtual Base1
{

public:
    int b;
    B(int b1, int age) : b(b1), Base1(age) {}
    virtual void printAge() {
        cout<< "B" << age << endl;
    }
};

class C : public virtual Base1
{

public:
    int c;
    C(int c1, int age) : c(c1), Base1(age) {}
    virtual void printAge() {
        cout<< "C" << age << endl;
    }
};

class D : public B, public C
{
public:
    int d;

    D(int d1, int b, int c, int age) : Base1(age), d(d1), B(b, age), C(c, age) {}
    virtual void printAge() {
        cout<< "D" << age << endl;
    }
};

#endif